import { icepick } from "@/icepick-client";
import z from "zod";
// TODO: Import your tools here
// Example: import { myTool } from "@/tools/my-tool";

const {{pascalCase name}}AgentInput = z.object({
  // TODO: Define your input schema here. It is recommended to use descriptions for all fields. 
  message: z.string(),
});

const {{pascalCase name}}AgentOutput = z.object({
  // TODO: Define your output schema here. It is recommended to use descriptions for all fields.
  message: z.string(),
});

export const {{camelCase name}}Toolbox = icepick.toolbox({
  tools: [
    // TODO: Add your tools here
    // Example: myTool,
  ],
});

export const {{camelCase name}}Agent = icepick.agent({
  name: "{{kebabCase name}}-agent",
  executionTimeout: "1m",
  inputSchema: {{pascalCase name}}AgentInput,
  outputSchema: {{pascalCase name}}AgentOutput,
  description: "{{description}}",
  fn: async (input, ctx) => {
    const result = await {{camelCase name}}Toolbox.pickAndRun({
      prompt: input.message,
    });

    switch (result.name) {
      // TODO: Handle your tool results here
      // Example:
      // case "myTool":
      //   return {
      //     message: `Result: ${result.output}`,
      //   };
      default:
        return {{camelCase name}}Toolbox.assertExhaustive(result);
    }
  },
});
